package com.zdsoft.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

import com.zdsoft.entity.ArticleInfo;

public interface IArticleInfoMapper {
	@Insert("INSERT INTO article_info (content) values(#{content})")
	@SelectKey(statement="SELECT LAST_INSERT_ID()",before=false, keyProperty = "id",  resultType = Long.class)
	int saveInfo(ArticleInfo articleInfo);
	
	@Delete("DELETE FROM article_info where id =#{id}")
	int del(Long id);
	
	@Update("UPDATE article_info SET content=#{content} WHERE id=#{infoId}")
	int update(@Param("content")String content, @Param("infoId")Long infoId);

}
